/*userLed
Qiang.DAI
2025.07.25
yyyy.mm.dd
*/

#ifndef _USER_LED_H_
#define _USER_LED_H_

#include "main.h"
#include "userOutputPin.h"




typedef struct Led_class{
S_OutputPin_t	*LedPin_ptr;
} K_userLed_t;


extern K_userLed_t ledStatusIndicate;
extern K_userLed_t ledStatusRun;

void userLedOn(K_userLed_t *p,float blinkFqzSec);
void userLedOff(K_userLed_t *p);


#define LED_STAUS_RUN()	 userLedOn(&ledStatusRun,1.2)
#define LED_STAUS_RUN_LOCK()	 userLedOn(&ledStatusRun,0.2)

#define LED_STAUS_SYS_INIT_FAULT()	\
do{																	\
userLedOff(&ledStatusIndicate);			\
userLedOn(&ledStatusIndicate,0.2);		\
}while(0)
#define LED_STAUS_SYS_RUN_FAULT()		\
do{																	\
userLedOff(&ledStatusIndicate);			\
userLedOn(&ledStatusIndicate,0.6);		\
}while(0)
#define LED_STAUS_BATTERY_LOW()			\
do{																	\
userLedOff(&ledStatusIndicate);			\
userLedOn(&ledStatusIndicate,1);		\
}while(0)
#endif /*_USER_LED_H_*/

